[mirrors]
http://www.wireshark.org/download/src/all-versions/wireshark-1.10.2.tar.bz2

[vars]
filesize=26667284
sha512=fd2ad466b122e2044718d8b42d0b323293d2e7fe04af700a1e94d00c720f78ba664e9cdb9a7fb35a13a6f7d99d81e4345482ee8d98b7538972a3f23250a44702
desc='sniff, decrypt, analyze and visualize network traffic'

[deps]
glib
libpcap
gtk+2
libgcrypt
gnutls
lua

[build]
patch -p1 < "$K"/wireshark-window-icon.patch
patch -p1 < "$K"/wireshark-dirent_macros.patch

for i in ui/export_object_smb.c epan/dissectors/packet-ssl-utils.c ; do
	sed -i 's@g_memmove@memmove@g' "$i"
done
sed -i 's@DISABLE_DEPRECATED@ENABLE_DEPRECATED@g' configure

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir"

printf "#!/bin/sh\necho -lpcap\n" > pcap-config
chmod +x pcap-config
export PATH="$PWD:$PATH"

CPPFLAGS=-D_GNU_SOURCE \
CFLAGS="$optcflags -Werror=implicit-function-declaration" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags

[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make -C tools/lemon V=1 CC_FOR_BUILD=gcc
make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
install -m644 -D wireshark.desktop "$dest/share/applications/wireshark.desktop"
install -m644 -D image/wsicon48.png "$dest/share/pixmaps/wireshark.png"
